package com.panshi.service;

import com.panshi.entity.AppMatterCheckT;
import com.panshi.entity.AppMatterT;
import com.panshi.entity.ClassifyT;
import com.panshi.service.impl.QaClientServiceFallbackFactory;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@Service
@FeignClient(value = "HASBEI-QA-PROVIDER-8003-XHLMR",fallbackFactory = QaClientServiceFallbackFactory.class)
public interface QaClientService {

    //乐观锁增加浏览量
    @GetMapping("/app-matter-t/matterReadAdd/{matterId}")
    public Boolean matterReadAdd(@PathVariable int matterId);

    //增加评论量
    @GetMapping("/app-matter-t/matterCommAdd/{matterId}")
    public Boolean matterCommAdd(@PathVariable int matterId);

    @GetMapping("/app-matter-t/all")
    public List<AppMatterT> amall();

    @GetMapping("/classify-t/bycid/{id}")
    public ClassifyT bycid(@PathVariable("id") Integer id);

    @GetMapping("/classify-t/zall")
    public List<ClassifyT> zall();

    @GetMapping("/app-matter-t/matById/{id}")
    public AppMatterT matById(@PathVariable("id") int id);

    @ApiOperation("咨询指定分页查询页数与个数  cid分类  page咨询页数 ，limit 多少  type 按排序")
    @GetMapping("/app-matter-t/qaPage/{cid}/{page}/{limit}/{type}")
    public List<AppMatterT> qaPage(@PathVariable int cid,@PathVariable int page, @PathVariable int limit, @PathVariable String type);

    @ApiOperation("问答指定分页查询页数与个数  cid分类  page咨询页数 ，limit 多少  type answerCount 按已回答未回答")
    @GetMapping("/app-matter-t/qaPage/{cid}/{page}/{limit}/{type}/{answerCount}")
    public List<AppMatterT> qaAnTypePage(@PathVariable int cid,@PathVariable int page, @PathVariable int limit, @PathVariable String type,@PathVariable int answerCount);

    @ApiOperation("问答审核表添加")
    @PostMapping("/app-matter-check-t/getMatterCheckAdd")
    public Boolean setMatterCheckAdd(@RequestBody AppMatterCheckT appMatterCheckT);
}
